package org.hive.testserver.domain.model.schedule;

import org.hive.testserver.domain.model.Slave;
import org.hive.testserver.domain.model.Test;
import org.hive.testserver.domain.model.WorkSheet;

/**
 * Accept tests that have been marked for rerunning.
 */
public class RescheduledTestAllocator extends BaseAllocatorLink {

	public RescheduledTestAllocator(AllocatorLink next) {
		super(next);
	}

	private static final long serialVersionUID = 1L;

	@Override
	protected ScheduleReason scheduledReason() {
		return ScheduleReason.RESCHEDULED;
	}

	@Override
	protected boolean shouldAccept(Test test, Slave slave, WorkSheet workSheet) {
		return workSheet.isTestRescheduled(test);
	}

}
